//
//  ZLAlert.h
//  ZLAlert-OC
//
//  Created by 科大 on 2024/1/2.
//

#import <UIKit/UIKit.h>
#import <Masonry/Masonry.h>
#import "ZLAlertMainView.h"
#import "ZLAlertConfig.h"
#import "ZLAlertAnimation.h"

NS_ASSUME_NONNULL_BEGIN

/// 单按钮回调
typedef void (^ZlAlertAction)(void);

@interface ZLAlert : UIViewController
/// 弹窗
@property (nonatomic, strong) ZLAlertMainView *mainView;

/// 高度计算
/// - Parameter bottom: 底部距离
- (ZLAlert *)layoutMainView:(CGFloat)bottom;

/// 增加自定义视图（视图固定高度或自适应撑起高度）
/// - Parameter customView: 视图
/// - Parameter insets: 缩进
- (ZLAlert *)addCustomView:(UIView *)customView;
- (ZLAlert *)addCustomView:(UIView *)customView insets:(UIEdgeInsets)insets;

/// 显示弹窗
- (void)show;

/// 关闭弹窗
- (void)close:(ZlAlertAction)closeAction;

/// 显示并且点击背景会关闭
/// - Parameter closeAction: 关闭回调
- (void)showWithTapBackgroundClose:(ZlAlertAction)closeAction;

@end

NS_ASSUME_NONNULL_END
